public class Text3 {
    public ListNode FindFirstCommonNode(ListNode pHead1, ListNode pHead2) {
        // BM10 两个链表的第一个公共结点
        ListNode L1 = pHead1;
        ListNode L2 = pHead2;
        while(L1 != L2){
            // 当短环到头后会跳转到长环，长环同理，所以下一圈他们会在入口处相遇
            L1 = (L1==null)?pHead2:L1.next;
            L2 = (L2==null)?pHead1:L2.next;
        }
        return L1;
    }
}
